home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 9
/
Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO
/
011a
/
grtmd6a1.zip
/
INSTALL.SCR
< prev
next >
Wrap
Text File
|
1993-01-05
|
27KB
|
932 lines
# $Header: D:/GM6/S/SRC/DIST/GMINST/VCS/GM60U.SCV 1.4 05 Jan 1993 15:31:12 RDJ $
#
# GM60U.SCR - installation script for GM version 6.0 Update (1993 MeSH)
#
# See the end of this file for floppy contents and maintenance history.
#
#
# Setup
#
# &GMINST is set by the GMINST program to the drive and directory
# from which GMINST was loaded. Derive just the drive from that
# for messages.
#
F_PARSE &GMINST -DRIVE GMINSTD
F_UNPARSE GMINSTD -DRIVE &GMINSTD
SETSTR GMPATH ""
#
# The INSTOPT DOS environment variable controls whether the
# installation is from floppies (normal) or from a network
# disk and to circumvent the free disk space check. (See
# the block comment at the end of this file for details.)
#
GETENVSTR INSTOPT "INSTOPT" # "INSTOPT" must be in uppercase
#
# Set colors depending on display type.
#
SETSTR CINFO "WHITE"
SETSTR CPRMPT "WHITE"
SETSTR CERR "YELLOW"
SETSTR CDISK "BRWHITE"
MCW_GETVIDEO -ADAPTER A
MCW_GETVIDEO -MONITOR M
IFSTR &A == MDPA
DO
IFSTR &M == MONO
DO
SETSTR CINFO "WHITE"
SETSTR CPRMPT "BRWHITE"
SETSTR CERR "BRWHITE"
END
END
#
# If CTRL-C is pressed, abort the installation.
#
ONCOND CTRLC
GOTO ABORT_CTRLC
ONCOND CRITERR
GOTO ABORT_CRITERR
#
# Clear the screen.
#
MCW_WINDOW -ID SCREEN -R1 1 -R2 24 -C1 1 -C2 80 -FG WHITE -BG BLACK
MCW_MKTEXT
MCW_CONTROL CLEAR
#
# Welcome Screen
#
# The TITLE window persists throughout installation.
# Describe the installation and obtain the destination path, &GMPATH.
#
MCW_WINDOW -ID TITLE -NAME "" -FG &CINFO -R1 1 -R2 3 -C1 17 -C2 63
MCW_MKTEXTSTR " Installing Grateful Med Version 6.0 Update "
MCW_WINDOW -ID WHATAMI -NAME " ABOUT THIS UPDATE " -FG &CINFO -R1 5 -R2 14 -C 62
MCW_MKTEXT
MCW_PRINTF " This Update modifies Grateful Med 6.0 to reflect changes\n"
MCW_PRINTF " made to the NLM computer and to incorporate the 1993 MeSH.\n"
MCW_PRINTF " It is important to install this Update to maintain search\n"
MCW_PRINTF " effectiveness. This Update is a supplement to Version 6.0\n"
MCW_PRINTF " and should be installed in the same subdirectory.\n\n"
MCW_PRINTF " For assistance or more information, contact the MEDLARS\n"
MCW_PRINTF " Service Desk at 1-800-638-8480."
MCW_WINDOW -ID INSDEST -NAME " INSTALLATION " -FG &CINFO -R1 16 -R2 24 -C 70
MCW_MKTEXT
MCW_PRINTF " This Update will be installed in the following directory:"
MCW_CONTROL POS 5 1
MCW_PRINTF " If this is incorrect, modify it to indicate the location of the\n"
MCW_PRINTF " Grateful Med 6.0 program. Use the Backspace key to edit.\n"
MCW_PRINTF " Press Enter to contine or Esc to abort."
MCW_WINDOW -ID WHERE_P -NAME "" -R1 18 -R2 20 -C 36 -FG &CPRMPT -BG BLACK
MCW_MKTEXT
MCW_CONTROL CLEAR
MCW_PRINTF "C:\\GM6" # default destination path
GET_GMPATH:
MCW_CONTROL EDIT -EXITKEY KEY
IFSTR &KEY == "ESC"
DO
MCW_DROP -ID WHERE_P -DELETE
MCW_DROP -ID INSDEST -DELETE
MCW_DROP -ID WHATAMI -DELETE
GOTO ABORT
END
IFSTR &KEY != "ENTER" # ignore all other keypresses
DO
ECHO "\x07" -NO_NEWLINE
GOTO GET_GMPATH
END
MCW_GET CONTENTS GMPATH
IFSTR &GMPATH == "" # disallow blank; confuses normalization
DO
ECHO "\x07" -NO_NEWLINE
GOTO GET_GMPATH
END
#
# Normalize path. If just drive is specified, get current
# dir for that drive. Ensure no trailing backslash.
#
SETSTR X &GMPATH # normalize path
IFSTR &X !==| ":" # not just drive
DO
IFSTR &X !==| "\\" # no trailing backslash
SETSTRF X "%s\\" &X # need it for parsing
END
F_PARSE &X -DRIVE D -dir DI
IFSTR &D != ""
SETSTRF D "%s:" &D # look like a drive again
IFSTR &DI == ""
F_INFO CURRENT_DIR GMPATH -DRIVE &D
IFSTR &DI != ""
SETSTRF GMPATH "%s%s" &D &DI
#
# Ensure dir exists
#
IFSTR &GMPATH !==| "\\" # e.g. not "c:\"
DO
F_INFO ATTR X &GMPATH
IFERR
DO
GET_GMPATH_ERR:
SETSTRF MSG "%s is not a subdirectory.\nPlease reenter." &GMPATH
GOSUB SHOW_MSG
GOTO GET_GMPATH
END
IFSTR &X !~ "D" # not reported for "c:\"
GOTO GET_GMPATH_ERR # not a directory
END
SETSTRF XS "%s\SEARCH.EXE" &GMPATH
F_INFO ATTR X &XS # SEARCH.EXE indicates GM installed
IFERR
DO
SETSTRF MSG "%s not found,\nso Grateful Med 6.0 is not present in that subdirectory." &XS
GOSUB SHOW_MSG
GOTO GET_GMPATH
END
SETSTR XS ""
MCW_DROP -ID WHERE_P -DELETE
MCW_DROP -ID INSDEST -DELETE
MCW_DROP -ID WHATAMI -DELETE
#
# If either TREE.DCT or TREE.IND are missing, installation
# of the tree files is optional.
#
SETSTRF X "%s\\%s" &GMPATH TREE.DCT
F_INFO SIZE X &X
IFERR
GOTO NO_TREE
SETSTRF X "%s\\%s" &GMPATH TREE.IND
F_INFO SIZE X &X
IFERR
GOTO NO_TREE
SETSTR MESHTREE "Y" # assume want to install Expanded MeSH
SETSTR TREEIND "Y" # assume Expanded MeSH exists in installed GM
GOTO HAVE_TREE
#
# Select option of installing tree files or not.
#
NO_TREE:
SETSTR TREEIND "N"
MCW_WINDOW -ID TREEXP -NAME " EXPANDED MeSH " -FG &CINFO -R1 5 -R2 14 -C 60
MCW_MKTEXT
MCW_PRINTF " The Expanded MeSH feature was not installed in sub-\n"
MCW_PRINTF " directory %s\n\n" &GMPATH
MCW_PRINTF " This feature requires 360K of hard disk space and will\n"
MCW_PRINTF " show the more specific terms included under a MeSH term.\n"
MCW_PRINTF " If you want to install the Expanded MeSH now, answer YES\n"
MCW_PRINTF " to the question below. If you do not want to install\n"
MCW_PRINTF " this feature, answer NO."
MCW_WINDOW -ID INSTREE -NAME " OPTION " -FG &CPRMPT -BG BLACK -R1 16 -R2 25 -C 60
MCW_MENU CLEAR
MCW_MENU DEFINE -PRE " Do you want to install the Expanded MeSH feature?\n\n"
SETSTR X "\n Use the up or down arrow keys to highlight your choice\n and press Enter to continue or Esc to abort."
MCW_MENU DEFINE -POST &X
MCW_MENU DEFINE -ITEM "Y" "Yes"
MCW_MENU DEFINE -ITEM "N" "No"
SETSTR MESHTREE "Y" # default selection is highlighted first
NTREE_SEL:
MCW_MENU SELECT -VALUE MESHTREE -EXITKEY KEY
MCW_DROP -ID TREEXP -DELETE
MCW_DROP -ID INSTREE -DELETE
IFSTR &KEY == "ESC"
GOTO ABORT
IFSTR &KEY != "ENTER"
GOTO NTREE_SEL
HAVE_TREE:
IFSTR &INSTOPT ~~ "NOS" # "NOSpacecheck" installation option
GOTO SPACE_DONE
#
# Ensure sufficient free space exists on the target disk.
# Disk space requirements were calculated by adding the
# byte counts of all the files, adding 8KB for each file
# (10 for full, 8 for no-tree installation), then adding
# 16KB as fudge.
#
SETSTR SPACEREQ "1331078"
IFSTR &MESHTREE == "N"
SETSTR SPACEREQ "949078"
F_INFO FREESPACE X -DRIVE &GMPATH
IFNUM &X < &SPACEREQ
DO
MCW_WINDOW -ID MSG -NAME "" -FG &CERR -R1 5 -R2 10 -C 65
MCW_MKTEXT
MCW_PRINTF " There is insufficient disk space to complete the installation\n"
MCW_PRINTF " in %s\n" &GMPATH
MCW_PRINTF " %s bytes are required, but only %s are available.\n" &SPACEREQ &X
MCW_PRINTF " (Press Enter to continue.)"
SPACE_GETCH:
KBD_GETCH -VALUE KEY
IFSTR &KEY != "ENTER"
GOTO SPACE_GETCH
MCW_DROP -ID MSG -DELETE
GOTO ABORT
END
SPACE_DONE:
#
# Summarize what will be done during the installation.
#
SETSTR X "N"
IFSTR &TREEIND == "N"
DO
IFSTR &MESHTREE == "Y"
SETSTR X "Y"
IFSTR &MESHTREE == "N"
SETSTR X "X"
END
IFSTR &X == "N"
MCW_WINDOW -ID SUMMARY -NAME " SUMMARY " -FG &CINFO -R1 5 -R2 10 -C 72
IFSTR &X != "N"
MCW_WINDOW -ID SUMMARY -NAME " SUMMARY " -FG &CINFO -R1 5 -R2 11 -C 72
MCW_MKTEXT
MCW_PRINTF " Version 6.0 Update will be installed in subdirectory\n %s\n" &GMPATH
IFSTR &X == "Y"
MCW_PRINTF " The Expanded MeSH feature will be included.\n"
IFSTR &X == "X"
MCW_PRINTF " The Expanded MeSH feature will not be included.\n"
MCW_PRINTF "\n Press Enter to begin or Esc to abort."
WAITINST:
KBD_GETCH -VALUE KEY
IFSTR &KEY == "ESC"
DO
MCW_DROP -ID SUMMARY -DELETE
GOTO ABORT
END
IFSTR &KEY == "ENTER"
DO
MCW_DROP -ID SUMMARY -DELETE
GOTO BEGINST
END
GOTO WAITINST
#
# Begin installation.
#
BEGINST:
#
# If TREE.DCT exists, this is a 3.5" disk set.
# Set &INST to 3 for 3.5" or 5 for 5.25".
#
SETSTRF INST "3"
SETSTRF X "%s%s" &GMINST TREE.DCT
F_INFO ATTR X &X
IFERR
SETSTRF INST "5"
#
# Display progress in a window.
#
MCW_WINDOW -ID STAT -NAME " INSTALLATION " -R1 5 -R2 18 -C 78
MCW_MKTEXT
MCW_CONTROL POS 13 1
#
# Copy all files from floppies to temporary files on disk.
#
# (&NVOL is used in a CHECKVOL prompt.)
#
SETSTR NVOL ""
SETSTR VOL "1 OF 2"
IFSTR &INST == "5"
SETSTR VOL "1 OF 4"
GOSUB CHECKVOL
SETSTRF INFILE "%s%s" &GMINST DBS
SETSTRF OUTFILE "%s\\%s" &GMPATH DBS.NEW
GOSUB FCOPY
IFERR
GOTO INST_ERR
SETSTRF INFILE "%s%s" &GMINST REVIEW.LST
SETSTRF OUTFILE "%s\\%s" &GMPATH REVIEW.NEW
GOSUB FCOPY
IFERR
GOTO INST_ERR
SETSTRF INFILE "%s%s" &GMINST GMTERMS.SYN
SETSTRF OUTFILE "%s\\%s" &GMPATH GMTERMS.NEW
GOSUB FCOPY
IFERR
GOTO INST_ERR
SETSTRF INFILE "%s%s" &GMINST JOURNAL.LST
SETSTRF OUTFILE "%s\\%s" &GMPATH JOURNAL.NEW
GOSUB FCOPY
IFERR
GOTO INST_ERR
SETSTRF INFILE "%s%s" &GMINST WHATAMI.BAT
SETSTRF OUTFILE "%s\\%s" &GMPATH WHATAMIB.NEW
GOSUB FCOPY
IFERR
GOTO INST_ERR
SETSTRF INFILE "%s%s" &GMINST WHATAMI.U01
SETSTRF OUTFILE "%s\\%s" &GMPATH WHATAMI1.NEW
GOSUB FCOPY
IFERR
GOTO INST_ERR
SETSTRF INFILE "%s%s" &GMINST MESHN.IND
SETSTRF OUTFILE "%s\\%s" &GMPATH MESHNI.NEW
GOSUB FCOPY
IFERR
GOTO INST_ERR
IFSTR &MESHTREE == "N"
DO
IFSTR &TREEIND == "N"
DO
MCW_CONTROL SCROLL +2
MCW_PRINTF "\rNot installing Expanded MeSH feature."
END
END
IFSTR &MESHTREE == "Y"
DO
IFSTR &TREEIND == "N"
DO
MCW_CONTROL SCROLL +2
MCW_PRINTF "\rInstalling Expanded MeSH feature."
END
SETSTRF INFILE "%s%s" &GMINST TREE.IND
SETSTRF OUTFILE "%s\\%s" &GMPATH TREEI.NEW
GOSUB FCOPY
IFERR
GOTO INST_ERR
END
IFSTR &INST == "5"
GOTO INST_5
#
# 3.5" disk
#
# TREE.DCT on #1, MESHN.DC1 on #1, MESHN.DC2 on #2.
#
IFSTR &MESHTREE == "Y"
DO
SETSTRF INFILE "%s%s" &GMINST TREE.DCT
SETSTRF OUTFILE "%s\\%s" &GMPATH TREED.NEW
GOSUB FCOPY
IFERR
GOTO INST_ERR
END
SETSTRF OUTFILE "%s\\%s" &GMPATH MESHND.NEW
GOSUB FOPEN_O
IFERR
GOTO INST_ERR
SETSTRF INFILE "%s%s" &GMINST MESHN.DC1
GOSUB FCOPY_O_OPENED
IFERR
GOTO INST_ERR
SETSTR VOL "2 OF 2"
GOSUB CHECKVOL
SETSTRF INFILE "%s%s" &GMINST MESHN.DC2
GOSUB FCOPY_O_OPENED
IFERR
GOTO INST_ERR
GOSUB FCLOSE_O
IFERR
GOTO INST_ERR
GOTO INST_ALLCOPY
#
# 5.25" disk
#
# TREE.DC1 on #2, TREE.DC2 on #1, MESHN.DC1 on #1,
# MESHN.DC2 on #3, MESHN.DC3 on #4.
#
INST_5:
SETSTRF OUTFILE "%s\\%s" &GMPATH MESHND.NEW
SETSTRF INFILE "%s%s" &GMINST MESHN.DC1
GOSUB FCOPY
IFERR
GOTO INST_ERR
IFSTR &MESHTREE == "Y"
DO
SETSTRF OUTFILE "%s\\%s" &GMPATH TREED.NEW
GOSUB FOPEN_O
IFERR
GOTO INST_ERR
SETSTRF INFILE "%s%s" &GMINST TREE.DC1
GOSUB FCOPY_O_OPENED
IFERR
GOTO INST_ERR
SETSTR VOL "2 OF 4"
GOSUB CHECKVOL
SETSTRF INFILE "%s%s" &GMINST TREE.DC2
GOSUB FCOPY_O_OPENED
IFERR
GOTO INST_ERR
GOSUB FCLOSE_O
IFERR
GOTO INST_ERR
END
SETSTRF OUTFILE "%s\\%s" &GMPATH MESHND.NEW
GOSUB FOPEN_OA
IFERR
GOTO INST_ERR
IFSTR &MESHTREE != "Y"
SETSTR NVOL "2 OF 4" # for CHECKVOL "volume not needed" prompt
SETSTR VOL "3 OF 4"
GOSUB CHECKVOL
IFSTR &MESHTREE != "Y"
SETSTR NVOL ""
SETSTRF INFILE "%s%s" &GMINST MESHN.DC2
GOSUB FCOPY_O_OPENED
IFERR
GOTO INST_ERR
SETSTR VOL "4 OF 4"
GOSUB CHECKVOL
SETSTRF INFILE "%s%s" &GMINST MESHN.DC3
GOSUB FCOPY_O_OPENED
IFERR
GOTO INST_ERR
GOSUB FCLOSE_O
IFERR
GOTO INST_ERR
GOTO INST_ALLCOPY
INST_ALLCOPY:
#
# All floppies have been copied to temporary files.
# Delete old files and rename temporary files.
#
MCW_CONTROL SCROLL +1
SETSTR INFILE DBS.NEW
SETSTR OUTFILE DBS
GOSUB FREPLACE
IFERR
GOTO INST_ERR
SETSTR INFILE REVIEW.NEW
SETSTR OUTFILE REVIEW.LST
GOSUB FREPLACE
IFERR
GOTO INST_ERR
SETSTR INFILE GMTERMS.NEW
SETSTR OUTFILE GMTERMS.SYN
GOSUB FREPLACE
IFERR
GOTO INST_ERR
SETSTR INFILE JOURNAL.NEW
SETSTR OUTFILE JOURNAL.LST
GOSUB FREPLACE
IFERR
GOTO INST_ERR
SETSTR INFILE WHATAMIB.NEW
SETSTR OUTFILE WHATAMI.BAT
GOSUB FREPLACE
IFERR
GOTO INST_ERR
SETSTR INFILE WHATAMI1.NEW
SETSTR OUTFILE WHATAMI.U01
GOSUB FREPLACE
IFERR
GOTO INST_ERR
IFSTR &MESHTREE == "Y"
DO
SETSTR INFILE TREEI.NEW
SETSTR OUTFILE TREE.IND
GOSUB FREPLACE
IFERR
GOTO INST_ERR
SETSTR INFILE TREED.NEW
SETSTR OUTFILE TREE.DCT
GOSUB FREPLACE
IFERR
GOTO INST_ERR
END
SETSTR INFILE MESHNI.NEW
SETSTR OUTFILE MESHN.IND
GOSUB FREPLACE
IFERR
GOTO INST_ERR
SETSTR INFILE MESHND.NEW
SETSTR OUTFILE MESHN.DCT
GOSUB FREPLACE
IFERR
GOTO INST_ERR
# MCW_CONTROL SCROLL +2
# MCW_PRINTF "\rInstallation complete. Press Enter to exit."
MCW_WINDOW -ID DONE -NAME "" -FG &CDISK -R1 20 -R2 23 -C 28
MCW_MKTEXT
MCW_PRINTF " Installation complete.\n"
MCW_PRINTF " Press Enter to exit."
ALLCOPY_GETENT:
KBD_GETCH -VALUE KEY
IFSTR &KEY != "ENTER"
GOTO ALLCOPY_GETENT
MCW_DROP -ID DONE -DELETE
MCW_DROP -ID STAT -DELETE
MCW_DROP -ID TITLE -DELETE
# No sense in doing this because we can't say "Enter SEARCH to begin."
# F_SET_CURRENT -DRIVE &GMPATH -DIR &GMPATH
# IFERR # not much we can do about it
# GOTO INST_DONE
MCW_DROP -ID SCREEN -DELETE
EXIT 0
#
# Subroutines.
#
ABORT_CTRLC: # When CTRL-C is pressed.
ONCOND CTRLC -REVERT
GOTO ABORT
ABORT_CRITERR:
ONCOND CRITERR -REVERT
MCW_WINDOW -ID CRIT -NAME " FATAL ERROR " -FG &CERR -R1 12 -R2 15 -C 60
MCW_MKTEXT
MCW_PRINTF " Critical error: %s" &OCE
IFSTR &OCD != ""
MCW_PRINTF " on drive %s" &OCD
MCW_PRINTF ".\n (Press the Esc key.)"
CRIT_GETESC:
KBD_GETCH -VALUE KEY
IFSTR &KEY != "ESC"
GOTO CRIT_GETESC
MCW_DROP -ID CRIT -DELETE
GOTO ABORT
ABORT: # Come here to abort installation.
MCW_WINDOW -ID ABORT -NAME " NOTE " -FG &CINFO -R1 12 -R2 15 -C 28
MCW_MKTEXT
MCW_CONTROL FG &CERR
MCW_PRINTF " Installation aborted.\n"
MCW_CONTROL FG &CINFO
MCW_PRINTF " Press the Esc key."
IFSTR &GMPATH != ""
DO # attempt to delete scratch files
SETSTR OUTFILE "DBS.NEW"
GOSUB COND_DEL_O
SETSTR OUTFILE "REVIEW.NEW"
GOSUB COND_DEL_O
SETSTR OUTFILE "GMTERMS.NEW"
GOSUB COND_DEL_O
SETSTR OUTFILE "JOURNAL.NEW"
GOSUB COND_DEL_O
SETSTR OUTFILE "WHATAMIB.NEW"
GOSUB COND_DEL_O
SETSTR OUTFILE "WHATAMI1.NEW"
GOSUB COND_DEL_O
SETSTR OUTFILE "TREEI.NEW"
GOSUB COND_DEL_O
SETSTR OUTFILE "TREED.NEW"
GOSUB COND_DEL_O
SETSTR OUTFILE "MESHNI.NEW"
GOSUB COND_DEL_O
SETSTR OUTFILE "MESHND.NEW"
GOSUB COND_DEL_O
END
ABORT_GETESC:
KBD_GETCH -VALUE KEY
IFSTR &KEY != "ESC"
GOTO ABORT_GETESC
MCW_DROP -ID ABORT -DELETE
MCW_DROP -ID SCREEN -DELETE
EXIT 1
INST_ERR: # Display fatal error msg and abort installation.
MCW_CONTROL SCROLL +1
MCW_PRINTF "\r%s" &EMSG
SETSTR MSG &EMSG
GOSUB SHOW_MSG
GOTO ABORT
SHOW_MSG: # Show informational message in a window.
# SETSTRF X "%s\n(Press Enter to continue or Esc to abort.)" &MSG
# MCW_WINDOW -ID MSG -NAME "" -FG &CERR -R1 21 -R2 21 -C 60
# MCW_MKTEXTSTR &X
MCW_WINDOW -ID MSG -NAME "" -FG &CERR -R1 21 -R2 25 -C 76
MCW_MKTEXT
MCW_PRINTF "%s\n" &MSG
MCW_PRINTF "(Press Enter to continue or Esc to abort.)"
SHOW_GETCH:
KBD_GETCH -VALUE KEY
IFSTR &KEY == "ESC"
DO
MCW_DROP -ID MSG -DELETE
GOTO ABORT
END
IFSTR &KEY != "ENTER"
GOTO SHOW_GETCH
MCW_DROP -ID MSG -DELETE
RETURN
CHECKVOL: # Ensure that disk with label &VOL is in the drive.
IFSTR &INSTOPT ~~ "NOF" # "NOFloppy" installation option
RETURN # not a floppy installation - all files in one dir
F_INFO LABEL X -DRIVE &GMINSTD
IFERR
DO
SETSTRF EMSG "\nI/O error reading drive %s." &GMINSTD
GOTO INST_ERR
END
IFSTR &VOL != &X
DO
ECHO "\x07" -NO_NEWLINE
SETSTR MSG ""
IFSTR &NVOL != ""
SETSTRF MSG ' Disk "%s" is not required.\n' &NVOL
SETSTRF MSG '%s Remove Disk "%s" and insert Disk "%s" in drive %s ' &MSG &X &VOL &GMINSTD
# GOSUB SHOW_MSG
SETSTRF MSG "%s\n (Press Enter to continue or Esc to abort.)" &MSG
MCW_WINDOW -ID MSG -NAME "" -FG &CDISK -R1 20 -R2 20 -C1 10 -C2 71
MCW_MKTEXTSTR &MSG
CHECKV_GETCH:
KBD_GETCH -VALUE KEY
IFSTR &KEY == "ESC"
DO
MCW_DROP -ID MSG -DELETE
GOTO ABORT
END
IFSTR &KEY != "ENTER"
GOTO CHECKV_GETCH
MCW_DROP -ID MSG -DELETE
GOTO CHECKVOL
END
RETURN
FOPEN_OA: # Open &OUTFILE for appending.
MCW_CONTROL SCROLL +2
MCW_PRINTF "\rResuming file %s" &OUTFILE
F_OPEN -ID OUTFILE &OUTFILE -MODE "ab"
IFERR
SETSTRF EMSG "Error opening %s for appending." &OUTFILE
RETURN
FOPEN_O: # Open &OUTFILE.
MCW_CONTROL SCROLL +2
MCW_PRINTF "\rCreating file %s" &OUTFILE
F_OPEN -ID OUTFILE &OUTFILE -MODE "wb"
IFERR
SETSTRF EMSG "Error opening %s for writing." &OUTFILE
RETURN
FCLOSE_O: # Close &OUTFILE and set modification time.
MCW_CONTROL SCROLL +1
MCW_PRINTF "\rCompleted file %s" &OUTFILE
F_CLOSE -ID OUTFILE
IFERR
DO
SETSTRF EMSG "Error closing output file %s." &OUTFILE
RETURN
END
F_SET_FILE &OUTFILE -MTIME &INMTIME
RETURN
FOPEN_I: # Open &INFILE and get modification time
MCW_CONTROL SCROLL +1
MCW_PRINTF "\rCopying file %s" &INFILE
F_INFO MTIME_NUM INMTIME &INFILE
IFERR
DO
SETSTRF EMSG "Unable to locate %s" &INFILE
RETURN
END
F_OPEN -ID INFILE &INFILE -MODE "rb"
IFERR
SETSTRF EMSG "Error opening %s for reading." &INFILE
RETURN
FCLOSE_I: # Close &INFILE.
F_CLOSE -ID INFILE
IFERR
SETSTRF EMSG "Error closing input file %s" &INFILE
RETURN
FCOPY: # Copy &INFILE to &OUTFILE.
GOSUB FOPEN_O
IFERR
RETURN
GOSUB FOPEN_I
IFERR
RETURN
GOSUB FCOPY_IO_OPENED
IFERR
RETURN
GOSUB FCLOSE_I
IFERR
RETURN
GOSUB FCLOSE_O
IFERR
RETURN
RETURN
FCOPY_O_OPENED: # Open &INFILE and copy to opened output file.
GOSUB FOPEN_I
IFERR
RETURN
GOSUB FCOPY_IO_OPENED
IFERR
RETURN
GOSUB FCLOSE_I
IFERR
RETURN
RETURN
FCOPY_IO_OPENED: # Copy opened input file to opened output file.
F_INFO SIZE INSIZE &INFILE
F_CALC BLOCKSIZE BLK -SIZE &INSIZE -BLOCKS 50
IFSTR &BLK == "0" # F_COPY -BYTES 0 -> copy whole file
GOTO COPY_NEXTBLK
# Display a percentage-complete bar if the file isn't tiny.
MCW_WINDOW -ID BART -FG &CINFO -R1 20 -R2 24 -C 54
MCW_MKTEXT
MCW_CONTROL POS 1 1
MCW_PRINTF "Press Esc to abort installation."
MCW_CONTROL POS 5 3
MCW_PRINTF "%s" "0% 25% 50% 75% 100%"
MCW_WINDOW -ID BAR -NAME " FILE COPY PROGRESS " -FG &CINFO -R1 21 -R2 23 -C 54
MCW_MKTEXT
MCW_CONTROL POS 1 2
COPY_NEXTBLK:
KBD_HIT # key pressed?
IFERR
DO
KBD_GETCH -VALUE KEY
IFSTR &KEY == "ESC"
DO
GOTO ABORT
END
END
IFSTR &BLK != "0"
MCW_PRINTF "\xb1"
F_COPY -IN INFILE -OUT OUTFILE -BYTES &BLK -VERIFY
IFERR 1
GOTO COPY_NEXTBLK
IFERR 100
SETSTRF EMSG "Error while reading %s" &INFILE
IFERR 200
SETSTRF EMSG "Error while writing %s" &OUTFILE
MCW_DROP -ID BAR -DELETE
MCW_DROP -ID BART -DELETE
MCW_WINDOW -ID STAT
RETURN
FREPLACE: # Delete &OUTFILE and rename &INFILE to &OUTFILE.
SETSTRF XI "%s\\%s" &GMPATH &INFILE
SETSTRF XO "%s\\%s" &GMPATH &OUTFILE
MCW_CONTROL SCROLL +1
MCW_PRINTF "\r"
F_INFO MTIME_NUM X &XO
IFERR 101 # F_ERRNO_NOTFOUND
GOTO FREPL_REN
MCW_PRINTF "Deleting file %-12s " &OUTFILE
F_DELETE &XO
IFERR
DO
SETSTRF EMSG "Error deleting file %s" &OUTFILE
RETURN
END
FREPL_REN:
MCW_PRINTF "Renaming file %s to %s" &INFILE &OUTFILE
F_MOVE &XI &XO
IFERR
DO
SETSTRF EMSG "Error renaming file %s to %s" &INFILE &OUTFILE
RETURN
END
RETURN
COND_DEL_O: # delete &OUTFILE if it exists
SETSTRF XI "%s\\%s" &GMPATH &OUTFILE
F_INFO MTIME_NUM INMTIME &XI
IFERR 101 # F_ERRNO_NOTFOUND
RETURN
F_DELETE &XI
SETERR 0 # ignore error
RETURN
#
# No lines are read by the script interpreter past the EOF statement.
#
EOF
#
# To prepare distribution floppy sets for Grateful Med 6.1A, organize
# the floppies as follows (be certain the floppies are labelled
# properly with the DOS "LABEL" command):
#
# 5.25" (360K) floppies 3.5" (720K) floppies
# --------------------- --------------------
# LABEL: 1 OF 4 LABEL: 1 OF 2
# INSTALL.EXE INSTALL.EXE
# INSTALL.SCR INSTALL.SCR
# DBS DBS
# GMTERMS.SYN GMTERMS.SYN
# JOURNAL.LST JOURNAL.LST
# REVIEW.LST REVIEW.LST
# WHATAMI.BAT WHATAMI.BAT
# WHATAMI.U01 WHATAMI.U01
# TREE.IND TREE.IND
# MESHN.IND MESHN.IND
# TREE.DC1 TREE.DCT
# MESHN.DC1 MESHN.DC1
# LABEL: 2 OF 4 LABEL: 2 OF 2
# TREE.DC2 MESHN.DC2
# LABEL: 3 OF 4
# MESHN.DC2
# LABEL: 4 OF 4
# MESHN.DC3
#
# Note that GMINST.EXE should be copied to the #1 floppies as
# INSTALL.EXE, and GM60U.SCR should be copied as INSTALL.SCR.
#
# To install, place disk #1 into a drive (e.g., A:) and run
# the INSTALL program:
#
# A:INSTALL
#
# To allow users to install when all the files are located in
# a single directory (e.g., from a LAN instead of from floppies),
# copy all of the files from one or the other disk set (3.5"
# or 5.25") and issue the following commands:
#
# SET INSTOPT=NOF
# [drive:][path]INSTALL
# SET INSTOPT=
#
# For either way of installing, the check for free disk space
# may be circumvented by defining "INSTOPT" to contain "NOS", e.g.
#
# SET INSTOPT=NOS
# A:INSTALL
# SET INSTOPT=
#
# or from a network directory:
#
# SET INSTOPT=NOF NOS
# [drive:][path]INSTALL
# SET INSTOPT=
#
# TO DO:
#
# - Possibly confirm installation abort.
# - Check for adequate free space on destination drive
# before beginning installation.
#
# History:
#
# $Revision: 1.4 $
# $Date: 05 Jan 1993 15:31:12 $
# $Log: D:/GM6/S/SRC/DIST/GMINST/VCS/GM60U.SCV $
#
# Rev 1.4 05 Jan 1993 15:31:12 RDJ
# Freeze for delivery to NLM.
#
# - 01/05/93 AAC RDJ
# - Did not deliver Rev 1.3 to NLM.
# - Incorporated UK's changes, accidentally omitted:
# - 12/17/92 AAC UK
# - Changed the way the WHATAMI file was being handled.
# Instead of having a single WHATAMI file, we have a batch
# file (WHATAMI.BAT) and a information file (WHATAMI.U01).
# This was done as per NLM's instructions.
#
# Rev 1.3 05 Jan 1993 14:33:32 RDJ
# Freeze for delivery to NLM.
#
# - 12/29/92 AAC RDJ
# - Add use of INSTOPT environment variable to support
# installations from a common LAN directory instead
# of from floppy disks and to circumvent the disk
# free space test. (See comments above.)
# - Add SPACEREQ variable and check that sufficient free
# space exists on the target disk before attempting
# the installation.
#
# Rev 1.2 10 Dec 1992 04:20:20 RDJ
# Freeze for 2nd delivery to NLM.
#
# - 12/09/92 AAC RDJ
# - Received new MeSH files from NLM on 12/07/92.
# - Changed volume labels to "1 OF 4", "2 OF 4", etc.
# to conform with NLM prompt change request.
# - Changed FREPLACE so it doesn't balk if the old file
# does not exist.
# - Changed COND_DEL_O so it checks properly that the
# file does not exist. (Thus, it doesn't ignore
# other kinds of errors.)
# - Add INSTALLATION message when installing or not
# installing Expanded MeSH.
# - Ensure that Esc/Enter windows don't drop window
# if another key is pressed.
# - If Expanded MeSH is not present in the existing GM,
# SUMMARY and INSTALLATION indicate whether the feature
# is being installed or excluded.
# - Normalize user-specified GMPATH so it always contains
# a directory specification. Changed usage of GMPATH
# consistent with this change. Displayed dir name has
# no backslash.
# - Put "installation complete" centered on the screen in
# bright white within its own box per NLM.
# - Could NOT display "Enter SEARCH to begin." because
# DOS insists on overwriting the message with its
# prompt. (This would need to be done in the script
# interpreter program because the script atexit procedures
# restore the video, i.e., clear the screen.)
#
# - 11/29/92 AAC RDJ
# - Applied changes per NLM/MMS.
# - Did NOT make disk change prompt read "1 of 4", etc.
# - Changed GM61A (volume label component) to GM60U everywhere.
# - Did NOT remove trailing blackslash from GMPATH.
#
# - 11/18/92 AAC RDJ
# - When user had installed GM6 without trees and responds
# "yes" to install the expanded MeSH from the update,
# the installation procedure complained that it could
# not delete TREE.IND.
# - Added new variable, "TREEIND", to record whether "TREE.IND"
# is present when the update is applied.
# - Call FREPLACE or FCOPY for "TREE.IND" and "TREE.DCT",
# depending on "TREEIND".
#
# Rev 1.1 21 Oct 1992 15:44:00 RDJ
# Freeze for Ugur.
#
# - 10/20/92 AAC RDJ
# - Rebuilt TREE.IN1/TREE.IN2 for 5.25" floppies and
# rearranged 5.25" file distribution.
# - Set modification times for newly created files to
# those on the floppy.
# - Split 5.25" copy to avoid floppy shuffling.
# - Added cleanup after aborted installation by deleting
# temporary files.
# - Added CTRL-C and critical error handlers.
#
# Rev 1.0 19 Oct 1992 15:39:20 RDJ
# Initial revision.
#
# - 10/18/92 AAC RDJ
# - Alpha test version ready.
# - Needs CTRL-C and critical error handlers.
# - Distribute this to Ugur for testing.
#
# [END OF FILE]